Fix: Factor out integer-only stdio into a common header #1537
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Detailed description
#include platform.h
This lead to flash size increase for 7 platforms (all not using newlib-nano) by 37 KiB because of linker pulling float/double capable stdio implementations (and softfp routines for double etc).platform_support.h
visible viageneral.h
to every platform excepthosted
.Your checklist for this pull request
make PROBE_HOST=native
)make PROBE_HOST=hosted
)Closing issues
Testing
To reproduce/verify,
make all_platforms
and compare binary sizes of files undersrc/artifacts/v1.9.0-...
for relevant revisions.Also Puncover to check for functions pulled from libc.
I don't know yet how to easily automatically perform checks for ENABLE_DEBUG=1 builds without encountering build failures or invoking make per-platform manually, but these binaries are Big anyways.
Miscellaneous
If there is a better header to place this in than
platform_support.h
, then I'll edit this branch.I could also edit the copyright string, author and filename for "stdio_newlib.h" as I'm only reorganizing the header contents and not actually writing implementation code in this PR. The touched
platform.h
headers contain at least three authors in "Written by" strings.